<div class="page-title">
  <h2>Detail Klaim Kartu Garansi (KKG) </h2>
</div>

<?php 
  $message = $this->session->flashdata('message');
  if ($message) : $div_class = $this->session->flashdata('div_class');
?>
  <div class="<?php $div_class; ?>">
    <?php echo $message; ?>
  </div>
<?php endif; ?>

<div class="page-trans page">
  <table class="full item-list">
    <thead>
      <tr>
        <th align="left">Teritory</th>
        <th width="20%">Nomor Transaksi</th>
        <th width="20%">Tanggal</th>
      </tr>
    </thead>
    <tbody>
      <tr class="highlight">
        <td>
          <?php 
            $territory = explode(' > ', $claim["header"]->territory); 
            echo $territory[0].' '.$territory[1];
          ?>
        </td>
        <td align="center"><?php echo substr("0000000". $claim["header"]->claim_id, -8); ?></td>
        <td align="center"><?php echo date('d F Y', strtotime($claim["header"]->claim_date)); ?></td>
      </tr>
    </tbody>
  </table>

  <table class="item-list">
    <thead>
      <tr>
        <th colspan="2">Informasi Umum</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Nama Sales</td>
        <td><?php echo $claim["header"]->user_id .' | '. $claim["header"]->user_name; ?></td>
      </tr>
      <tr>
        <td>Nama Partner</td>
        <td><?php echo $claim["header"]->channel_id .' | '. $claim["header"]->channel_name; ?></td>
      </tr>
      <tr>
        <td>Frontliner</td>
        <td>
          <?php 
            if($claim["header"]->frontliner_name)
              { echo $claim["header"]->frontliner_name; }
            else 
              { echo '&mdash;'; }
          ?>
        </td>
      </tr>
      <tr>
        <td>Program</td>
        <td><?php echo $claim["header"]->lookup_desc; ?></td>
      </tr>
    </tbody>
  </table>

  <table class="item-list full">
    <thead>
      <tr>
        <th>No.</th>
        <th>ICCID</th>
        <th>MDN</th>
        <th>Item Name</th>
        <th>Item Group</th>
      </tr>
    </thead>
    <thead>
      <?php 
        $x = 1;
        foreach ($claim["detail"] as $key) {
          echo '<tr>';
          echo '<td>'.$x.'</td>';
          echo '<td>'.$key->iccid.'</td>';
          echo '<td>'.$key->mdn.'</td>';
          echo '<td>'.$key->item_name.'</td>';
          echo '<td>'.$key->item_group_name.'</td>';
          $x++;
        }
      ?>
    </thead>
  </table>
</div>